Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a root filesystem override for kubelet mounter #35652

Merged

Conversation

vishh
Copy link
Contributor

@vishh vishh commented Oct 26, 2016

This is necessary to get hostPath volumes to work with containerized kubelet mounter


This change is Reviewable

@vishh vishh added priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. labels Oct 26, 2016
@vishh vishh added this to the v1.4 milestone Oct 26, 2016
@k8s-github-robot k8s-github-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 26, 2016
Copy link
Contributor

@mtaufen mtaufen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the reason for this new flag/mounter parameter to the commit message body?

@@ -187,6 +187,8 @@ exit-on-lock-contention
experimental-allowed-unsafe-sysctls
experimental-bootstrap-kubeconfig
experimental-keystone-url
experimental-mounter-path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this line will reduce your potential rebase burden, as this PR still relies on mounter-path and you already added experimental-mounter-path to known flags in #35646

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack. Done

@vishh vishh force-pushed the klet-overrride-mount-rootfs branch from 72ded47 to d17d01d Compare October 26, 2016 21:47
@@ -64,13 +66,13 @@ type Mounter struct {
func (mounter *Mounter) Mount(source string, target string, fstype string, options []string) error {
bind, bindRemountOpts := isBind(options)
if bind {
err := doMount(mounter.mounterPath, source, target, fstype, []string{"bind"})
err := doMount(mounter.mounterPath, path.Join(mounter.mounterRootfsPath, source), target, fstype, []string{"bind"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might miss something here, but source is already an absolute path?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source is already an absolute path in the native namespace. But from within the container, all native (root fs) paths have to be relative to the mounterRootfsPath.

return &Mounter{
mounterPath: mounterPath,
mounterPath: mounterPath,
mounterRootfsPath: mounterRootfsPath,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why this mounterRootfsPath is needed? how it works?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ to kubelet is /rootfs to the mounter container. So if kubelet wants to mount /foo/bar, then it has to pass /rootfs/foo/bar to the container.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that ok to put some comments about this somewhere in the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. PTAL

@mtaufen
Copy link
Contributor

mtaufen commented Oct 26, 2016

LGTM

@vishh vishh force-pushed the klet-overrride-mount-rootfs branch from d17d01d to c96aa14 Compare October 26, 2016 22:21
@jingxu97
Copy link
Contributor

LGTM

@jingxu97 jingxu97 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 26, 2016
@vishh vishh added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Oct 26, 2016
@vishh
Copy link
Contributor Author

vishh commented Oct 26, 2016

Bumping priority since this is blocking 2 other PRs which have to go in asap for v1.4.x patch release

@vishh vishh added lgtm "Looks good to me", indicates that a PR is ready to be merged. do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. labels Oct 26, 2016
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 27, 2016
@vishh vishh removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 27, 2016
@vishh
Copy link
Contributor Author

vishh commented Oct 27, 2016

This PR needs more work. Will pick it up tomorrow.

@vishh vishh force-pushed the klet-overrride-mount-rootfs branch from c96aa14 to 0446784 Compare October 27, 2016 04:41
@vishh vishh removed the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Oct 27, 2016
@vishh
Copy link
Contributor Author

vishh commented Oct 27, 2016

Ok. I have fixed the issues with this PR.

This is useful for supporting hostPath volumes via containerized
mounters in kubelet.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
@vishh vishh force-pushed the klet-overrride-mount-rootfs branch from 0446784 to e861a57 Compare October 27, 2016 04:43
@vishh vishh added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 27, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 69b214d into kubernetes:master Oct 27, 2016
pires added a commit to apprenda/kubernetes that referenced this pull request Oct 27, 2016
k8s-github-robot pushed a commit that referenced this pull request Oct 27, 2016
Automatic merge from submit-queue

Update GCI mounter script to run in a rkt container

Depends on #35652
@pires pires mentioned this pull request Oct 27, 2016
@jessfraz jessfraz added cherrypick-candidate cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. labels Oct 27, 2016
k8s-github-robot pushed a commit that referenced this pull request Oct 27, 2016
Automatic merge from submit-queue

Fixes PR #35652

This is breaking the build. Fixes #35564

/cc @vishh @sjenning

Fixes PR #35652
jessfraz pushed a commit to jessfraz/kubernetes that referenced this pull request Oct 28, 2016
@jessfraz jessfraz removed cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. cherrypick-candidate labels Oct 28, 2016
k8s-github-robot pushed a commit that referenced this pull request Oct 28, 2016
#35717-origin-release-1.4

Automatic merge from submit-queue

Automated cherry pick of #35721 #35717

Cherry pick of #35721 #35717 on release-1.4.

#35721: Fixes PR #35652
#35717: update rkt to v1.18.0 which avoids outputting debug
k8s-github-robot pushed a commit that referenced this pull request Nov 3, 2016
Automatic merge from submit-queue

[Kubelet] Use the custom mounter script for Nfs and Glusterfs only

This patch reduces the scope for the containerized mounter to NFS and GlusterFS on GCE + GCI clusters

This patch also enabled the containerized mounter on GCI nodes

Shepherding multiple PRs through the submit queue is painful. Hence I combined them into this PR. Please review each commit individually.

cc @jingxu97 @saad-ali

#35652 has also been reverted as part of this PR
shyamjvs pushed a commit to shyamjvs/kubernetes that referenced this pull request Dec 1, 2016
shyamjvs pushed a commit to shyamjvs/kubernetes that referenced this pull request Dec 1, 2016
…ck-of-#35721-kubernetes#35717-origin-release-1.4

Automatic merge from submit-queue

Automated cherry pick of kubernetes#35721 kubernetes#35717

Cherry pick of kubernetes#35721 kubernetes#35717 on release-1.4.

kubernetes#35721: Fixes PR kubernetes#35652
kubernetes#35717: update rkt to v1.18.0 which avoids outputting debug
dims pushed a commit to dims/openstack-cloud-controller-manager that referenced this pull request Mar 24, 2017
Automatic merge from submit-queue

[Kubelet] Use the custom mounter script for Nfs and Glusterfs only

This patch reduces the scope for the containerized mounter to NFS and GlusterFS on GCE + GCI clusters

This patch also enabled the containerized mounter on GCI nodes

Shepherding multiple PRs through the submit queue is painful. Hence I combined them into this PR. Please review each commit individually.

cc @jingxu97 @saad-ali

kubernetes/kubernetes#35652 has also been reverted as part of this PR
dims pushed a commit to dims/openstack-cloud-controller-manager that referenced this pull request Sep 6, 2017
Automatic merge from submit-queue

[Kubelet] Use the custom mounter script for Nfs and Glusterfs only

This patch reduces the scope for the containerized mounter to NFS and GlusterFS on GCE + GCI clusters

This patch also enabled the containerized mounter on GCI nodes

Shepherding multiple PRs through the submit queue is painful. Hence I combined them into this PR. Please review each commit individually.

cc @jingxu97 @saad-ali

kubernetes/kubernetes#35652 has also been reverted as part of this PR
dims pushed a commit to dims/openstack-cloud-controller-manager that referenced this pull request Jan 13, 2018
Automatic merge from submit-queue

[Kubelet] Use the custom mounter script for Nfs and Glusterfs only

This patch reduces the scope for the containerized mounter to NFS and GlusterFS on GCE + GCI clusters

This patch also enabled the containerized mounter on GCI nodes

Shepherding multiple PRs through the submit queue is painful. Hence I combined them into this PR. Please review each commit individually.

cc @jingxu97 @saad-ali

kubernetes/kubernetes#35652 has also been reverted as part of this PR
dims pushed a commit to dims/kubernetes that referenced this pull request Feb 8, 2018
…ootfs

Automatic merge from submit-queue

Adding a root filesystem override for kubelet mounter

This is necessary to get hostPath volumes to work with containerized kubelet mounter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants